import './container.css'
var Container = {
    name: 'Container',
    template: '<div ref="container" class="container" :style="{width:width+\'px\',height:height+\'px\'}"><slot/></div>',
    props: {
        width: {
            type: Number,
            default: function () {
                return 1920
            }
        },
        height: {
            type: Number,
            default: function () {
                return 1080
            }
        }
    },
    methods: {
        scale: function () {
            var widthScale = document.body.clientWidth / this.width;
            var heightScale = document.body.clientHeight / this.height;
            this.$refs.container.style.transform = 'scale(' + widthScale + ',' + heightScale + ')';
        }
    },
    mounted: function () {
        this.scale();
        window.addEventListener('resize', this.scale);
    }
}